home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: presby.edu!jtbell
- From: jtbell@presby.edu (Jon Bell)
- Subject: Re: Reading ENUMS from FILES
- Message-ID: <DprHKo.70C@presby.edu>
- Date: Fri, 12 Apr 1996 18:19:36 GMT
- References: <316EF715.37D8@mail.soton.ac.uk>
- Organization: Presbyterian College, Clinton, South Carolina USA
-
- jcridge <jcridge@mail.soton.ac.uk> wrote:
- >I've not been able to find a way of forcing C++ to read in my own
- >enumurated value types from files. I had thought that the SCANF
- >function would be able to cope, but it seems not. Could anyone help me
- >out here ?
-
- Standard C++ doesn't allow you to read enum values directly. You have to
- overload the >> operator with a function that reads characters and parses
- them to determine which enum value is being input.
-
- >Also, I'm used to PASCAL which made alot of things like this rather
- >easy,
-
- The Pascals I've worked with don't allow you to input enumerated types
- directly, either... you must have been lucky! :-)
-
- >including reading whole user defined RECORD structures
- >with mixed types, is this possible in C++ ?
-
- Yes, C++ has these. They're called "structs" and "classes". They can
- contain not only data, but also functions.
-
- --
- Jon Bell <jtbell@presby.edu> Presbyterian College
- Dept. of Physics and Computer Science Clinton, South Carolina USA
-